{itemplate 'public/header'}
<form action="./index.php" class="form-horizontal form-filter">
	{php echo tpl_form_filter_hidden('creditshop/order');}
	<input type="hidden" name="id" value="{$record_id}">
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">兑换时间</label>
		<div class="col-sm-4 col-xs-4">
			{php echo tpl_form_field_daterange('addtime', array('start' => date('Y-m-d', $starttime), 'end' => date('Y-m-d', $endtime)));}
		</div>
	</div>
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label">搜索</label>
		<div class="col-sm-4 col-xs-4">
			<input type="text" name="keyword" value="{$keyword}" class="form-control" placeholder="搜索的姓名、昵称、手机号">
		</div>
	</div>
	<div class="form-group">
		<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
		<div class="col-sm-4 col-xs-4">
			<input type="submit" value="筛选" class="btn btn-primary">
		</div>
	</div>
</form>
<form action="" class="form-table form" method="post">
	<div class="panel panel-table">
		<div class="panel-body table-responsive js-table">
			{if empty($orders)}
				<div class="no-result">
					<p>还没有相关数据</p>
				</div>
			{else}
				<table class="table table-hover">
					<thead>
					<tr>
						<th>ID</th>
						<th>订单号</th>
						<th>用户信息</th>
						<td>商品编号</td>
						<td>消耗积分</td>
						<th style="text-align: right">兑换时间</th>
					</tr>
					</thead>
					<tbody>
						{loop $orders $order}
							<tr>
								<td>{$order['id']}</td>
								<td>{$order['ordersn']}</td>
								<td>
									<img width="50" height="50" src="{php echo tomedia($order['avatar'])}" alt=""/>
									{$order['nickname']}
								</td>
								<td>{$order['itemcode']}</td>
								<td>{php echo floatval($order['credits'])}</td>
								<td align="right">{php echo date('Y-m-d H:i:s', $order['addtime'])}</td>
							</tr>
						{/loop}
					</tbody>
				</table>
				<div class="btn-region clearfix">
					<div class="pull-right">
						{$pager}
					</div>
				</div>
			{/if}
		</div>
	</div>
</form>
{itemplate 'public/footer'}
